/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.guobo.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.guobo.dao.CameraDao;
import com.thinkgem.jeesite.modules.guobo.entity.Camera;
import com.thinkgem.jeesite.modules.guobo.entity.Location;

/**
 * 摄像头Service
 * @author wudavid
 * @version 2017-03-09
 */
@Service
@Transactional(readOnly = true)
public class CameraService extends CrudService<CameraDao, Camera> {

	public Camera get(String id) {
		return super.get(id);
	}
	
	public List<Camera> findList(Camera camera) {
		return super.findList(camera);
	}
	
	public Page<Camera> findPage(Page<Camera> page, Camera camera) {
		return super.findPage(page, camera);
	}
	
	@Transactional(readOnly = false)
	public void save(Camera camera) {
		super.save(camera);
	}
	
	@Transactional(readOnly = false)
	public void delete(Camera camera) {
		super.delete(camera);
	}
	
	/**
	 * 根据位置查询摄像头
	 * @param camera
	 * @return
	 */
	public List<Camera> findListByLocid(String locationid){
		Location loc = new Location();
		loc.setId(locationid);
		Camera camera = new Camera();
		camera.setLocation(loc);
		return dao.findListByLocid(camera);
	}
}